#ifndef CONSTRAINT_H
#define CONSTRAINT_H

#include <iostream>
#include <vector>
#include "btBulletDynamicsCommon.h"
#include "src/brainz/brainz.h"


using namespace std;

class Constraint
{
public:
	Constraint(btDynamicsWorld* ownerWorld, btRigidBody& bodyA, btRigidBody& bodyB, btTransform& localA, btTransform& localB, double limitA, double limitB);
	~Constraint();

	void			motorate();
	float			getAngle();
	
  static unsigned int getNumberOfInputs();
  static unsigned int getNumberOfOutputs();
  static unsigned int registerInputs(BrainzArch* ba, unsigned int id);
  static unsigned int registerOutputs(BrainzArch* ba, unsigned int id);
  unsigned int        procInputs(Brainz&, unsigned int id);
  unsigned int        procOutputs(Brainz&, unsigned int id);

  const unsigned int*  absolutemotorneurons;
  const unsigned int*  maximumimpulse;

	vector<bool>		Inputs;
// 	btTypedConstraint*	hinge;
	btHingeConstraint*	hinge;
	float			fullRange;
	float			diffFromZero;
private:
	btDynamicsWorld* 	m_ownerWorld;

	bool			input1;
	bool			input2;
	
// 	float			limitA;
// 	float			limitB;
};
#endif
